//
//  UITextField+ILGUIKit.m
//  ILGDemo
//
//  Created by happy on 2020/2/23.
//  Copyright © 2020 Happy. All rights reserved.
//

#import "UITextField+ILGUIKit.h"

@implementation UITextField (ILGUIKit)

- (void)setupTextFieldPlaceholderTextColor:(UIColor *)color
{
    // 法一
    //    [textF setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
    
    // 法二
    //    UILabel *placeholderLbe = [textF valueForKeyPath:@"_placeholderLabel"];
    //    placeholderLbe.textColor = [UIColor redColor];
    
    // 法三
    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
    attrs[NSForegroundColorAttributeName] = [UIColor redColor];
    self.attributedPlaceholder =  [[NSMutableAttributedString alloc] initWithString:@"请输入用户名" attributes:attrs];
}

@end
